<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/commons/taglibs.jsp"%>
<%@ include file="/commons/commonList.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script language="JavaScript" type="text/javascript" src="${ctx}/scripts/ajaxException.js"></script>
<script language="JavaScript" src="${ctx}/scripts/common/prototype.js"></script>
<script type="text/javascript" src="${ctx}/scripts/div/common.js"></script>
<script type="text/javascript" src="${ctx}/scripts/common.js"></script>
<script type="text/javascript">
	var keyword = null;
	var url = null;
	//添加或编辑
	function showEditPage(isEdit){
		url = getAction('editPage');
		if(isEdit){
			if(keyword == null){
				Alert('请选择一条数据进行编辑操作！');
				return;
			}
			url = url + '&keyword=' + keyword;
			top.windowOpen(url, 'EditPage', '编辑申报项目', 480, 700, true, 'EditPageIFarm');
		}
		top.windowOpen(url, 'EditPage', '添加申报项目', 480, 700, true, 'EditPageIFarm');
	}



	//显示详细页面
	function showDetailPage(){

		url = getAction('detailPage');
		if(keyword == null){
			Alert('请选择一条数据才能查看！');
			return;
		}
		url = url + '&keyword=' + keyword;
		top.windowOpen(url, 'DetailPage', '申报项目详细内容', 330, 650,true,"DetailPageFrame");
	}

	//整改跟进
	function showTrackPage(hasToolbar){
		//var checkUrl = getAction('checkAddIsTrue') + '&keyword=' + keyword;
		//new Ajax.Request(checkUrl,{method: 'post' ,onSuccess : function(response){
			//ajaxSubmitException(response.responseText);

		url = getAction('trackInitPage') + '&keyword=' + keyword + '&hasToolbar=' + hasToolbar;
		var frameObj = findFrame("connTabPanel");
		if(frameObj != null){
			parent.showTrackPage(url);
		}else{
			top.windowOpen(url, 'TrackPage', '整改跟进', 450, 850, true, 'TrackPageFrame');
		}	//}});
	}

	//删除
	function itemDelete(){
	 	  if(keyword == null){
	 	   	Alert('请选择数据！');
	      return false;
	 	  }
	 	  else{
	 		url = getAction('checkDeleteIsTrue') + '&keyword=' + keyword;
			new Ajax.Request(url,{method: 'post' ,onSuccess : function(response){
			ajaxSubmitException(response.responseText);
		    	AskConfirm("${key.tipsByDeleteConfirm}","perfectItemRequisitionList","deleteItem");
			}});
	 	  }
	}
	function deleteItem(){
		url = getAction('delPerfectItemReq') + '&keyword=' + keyword;
		new Ajax.Request(url,{method: 'post' ,onSuccess : function(response){
			ajaxSubmitException(response.responseText);
			if(response.responseText == 'true'){
				refresh();
			}
		}});
	}

	//选择项
	function selectItem(selectId){
		keyword = selectId;
	}

	//取得Action
	function getAction(method){
		return '${ctx }/occupation_perfectItemRequisitionAction.do?method=' + method;
	}

	//刷新
	function refresh(){
		parent.refresh();
		keyword=null;
	}

	function setSize() {
		if(parent.window.document.all('perfectItemRequisitionList')==null)return false;
		
	  	parent.window.document.all('perfectItemRequisitionList').style.height=document.body.scrollHeight;

	}

	function rightMenu(event){
	 if(parent.window.document.all('perfectItemRequisitionList')==null)return false;
	 return ShowContextMenu(event,'quick_rightmenu');
	}
</script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>整改项目</title>
</head>
<body onload="javascript:setSize();">
<div>
<ec:ceTable items="queryDataList" action="${ctx }/occupation_perfectItemRequisitionAction.do?method=queryPerfectItemRequisitionByPage" var="item" view="pmsview" styleClass="gridData2" rowsDisplayed="15">
	<ec:ceRow styleClass="grid" ondblclick="javascript:showDetailPage();" onclick="javascript:selectItem('${item.keyword}');" onContextMenu="return rightMenu(event)">
		<ec:ceColumn headerCell="pmsHeadrCell" title="楼栋" property="buildingName" width="8%" sortable="true"/>
		<ec:ceColumn headerCell="pmsHeadrCell" title="房号" property="houseNumber" width="10%" sortable="true"/>
		<ec:ceColumn headerCell="pmsHeadrCell" title="管理房" property="coalitionHouseNumber" width="7%" />
		<ec:ceColumn headerCell="pmsHeadrCell" title="业主姓名" property="ownerName" width="9%" />
		<ec:ceColumn headerCell="pmsHeadrCell" title="申报项目类型" property="perfectItemTypeConfigName" width="10%" />
		<ec:ceColumn headerCell="pmsHeadrCell" title="问题描述" property="description" width="18%" />
		<ec:ceColumn headerCell="pmsHeadrCell" title="申报日期" property="perfectRequisitionDate" width="10%" sortable="true"/>
		<ec:ceColumn headerCell="pmsHeadrCell" title="派工状态" property="dispatchYnName" width="8%" />
		<ec:ceColumn headerCell="pmsHeadrCell" title="完工日期" property="completeDate" width="8%" />
		<ec:ceColumn headerCell="pmsHeadrCell" title="全部跟进状况" property="annalMan" width="10%" showTitle="false">
			<a href="javascript:selectItem('${item.keyword}');showTrackPage(false);" class="center_link_word">查看</a>
		</ec:ceColumn>
	</ec:ceRow>
</ec:ceTable>
</div>

<div id="quick_rightmenu" style="display: 1 #;" oncontextmenu="return false" class="quick_menu2" onMouseOver="showmy2menu('quick_rightmenu')" onMouseOut="hidden2menu('quick_rightmenu')">
<table width="100%" border="0" cellpadding="0" cellspacing="0" class="grid_quickMenu_bg">
	<tr>
		<td>
		<table width="100%" border="0" cellpadding="2" cellspacing="0">
			<pms:AuthTag authName="occupation_perfectItemRequisitionAction.do?method=addPerfectItemRequisition">
			<tr>
				<td class="quickMenu_toolbarico"><a href="#" onClick="javascript:showEditPage(false);" onFocus="this.blur()"><img src="${ctx}/images/ico_newfile.gif" border="0" align="absbottom" alt="新建" />&nbsp;新 增</a></td>
			</tr>
			</pms:AuthTag>
			<pms:AuthTag authName="occupation_perfectItemRequisitionAction.do?method=editPerfectItemRequisition">
			<tr>
				<td class="quickMenu_toolbarico"><a href="#" onClick="javascript:showEditPage(true);" onFocus="this.blur()"><img src="${ctx}/images/ico_amend.gif" border="0" align="absbottom" alt="修改" />&nbsp;修 改</a></td>
			</tr>
			</pms:AuthTag>
			<pms:AuthTag authName="occupation_perfectItemRequisitionAction.do?method=deletePerfectItemRequisition">
			<tr>
				<td class="quickMenu_toolbarico"><a href="#" onClick="javascript:itemDelete();" onFocus="this.blur()"><img src="${ctx}/images/ico_delete.gif" alt="" width="16" height="16" border="0" align="absbottom" /> 删 除</a></td>
			</tr>
			</pms:AuthTag>
			<pms:AuthTag authName="occupation_perfectItemRequisitionAction.do?method=trackInitPage">
			<tr>
				<td class="hrpading">
				<table width="95%" border="0" align="left" cellpadding="0" cellspacing="0">
					<tr>
						<td class="quickMenu_line"></td>
					</tr>
				</table>
				</td>
			</tr>
			<tr>
				<td class="quickMenu_toolbarico"><a href="#" onFocus="this.blur()" onClick="javascript:showTrackPage(true);"><img src="${ctx}/images/ico_zxsf_sq.gif" alt="整改跟进" border="0" align="absbottom" />&nbsp;整改跟进</a></td>
			</tr>
			</pms:AuthTag>

		</table>
		</td>
	</tr>
</table>
<script type="text/javascript">

	var div1=document.getElementById('quick_rightmenu');
	if(div1.getElementsByTagName("tr").length==1){
	div1.innerHTML="";
	}
</script>
</div>



</body>
</html>